<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta content="telephone=no" name="format-detection" /> 
<meta name="google-site-verification" content="DVVM1p1HEm8vE1wVOQ9UjcKP--pNAsg_pleTU5TkFaM">
<style>
	body > a:first-child,body > a:first-child img{ width: 0px !important; height: 0px !important; overflow: hidden; position: absolute}
	body{padding-bottom: 0 !important;}		
</style>
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>课程详情</title>
<link rel="stylesheet" href="{MODULE_URL}public/mobile/css/weixin.css">
<link rel="stylesheet" href="{OSSURL}public/mobile/css/reset.css">
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/greenStyle.css?v=4.80120" />
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<script src="{MODULE_URL}public/mobile/js/jquery.js"></script>
<script type="text/javascript" src="{OSSURL}public/mobile/js/PromptBoxUtil.js?v=4.80309"></script>
</head>
<style>
.count_inf .count_add {padding-left: 30px;background: url({OSSURL}public/mobile/img/address.png) no-repeat 10px center;background-size: 10px auto;}
.count_inf .count_phone {padding-left: 30px;background: url({OSSURL}public/mobile/img/phone.png) no-repeat 10px center;background-size: 11px auto;}	
.count_inf dl a {padding-right: 10px;display: block;background: url({OSSURL}public/mobile/img/arrow_right.png) no-repeat right center;background-size: 8px 12px;}		
</style>
<body>
    <div id="wrap" class="count_inf">
        <dl id="main">
            <dt class="count_tit">{$item['name']}</dt>
            <dd class="count_inf">
                <div class="teacher">
                    <div style=" background-image:url({php echo tomedia($teacher['thumb']);})" onclick="gototinfo();"></div>
                    <p>{$teacher['tname']}</p>
                </div>
                <ul>
                    <li><label>日期：</label>{php echo date('Y/m/d',$item['start'])}-{php echo date('Y/m/d',$item['end'])}</li>
                    <li><label>科目：</label>{if !empty($item['xq_id'])}{$category[$item['xq_id']]['sname']}/{$category[$item['bj_id']]['sname']}/{$category[$item['km_id']]['sname']}{else}{$category[$item['km_id']]['sname']}{/if}</li>
                    <li><label>教室：</label>{$item['adrr']}</li>
                </ul>               
                <div style="clear:both"></div>
            </dd>
       {if $school['issale'] == 5}
	        {else if $school['issale'] == 1 || $school['issale'] == 2 || $school['issale'] == 3 || $school['issale'] == 4}
			{if $item['is_hot']==1 && $item['end']>TIMESTAMP}
			<dd class="count_num">
			    {if $school['issale'] == 1 || $school['issale'] == 2}<span>￥{$item['cose']}</span>{/if}
                <span value="" class="count_hot" style="font-size:12px;"></span>
				<div class="btn" onclick="{if !empty($userinfo['name'])}checkSigeup(){else}Sigeup(){/if}">报名</div>
			</dd>	
            {else if $item['ishot'] == 0 && !$isfull && $item['end']>TIMESTAMP}
			<dd class="count_num">
                {if $school['issale'] == 1 || $school['issale'] == 2}<span>￥{$item['cose']}</span>{/if}
				
                <span value="{if $rest > 0}{$rest}个名额{else}0个名额{/if}" class="count_leave"></span>
                <div class="btn" onclick="{if !empty($userinfo['name'])}checkSigeup(){else}Sigeup(){/if}">报名</div>
			</dd>	
			{else if $isfull && $item['ishot'] ==0}
			<dd class="count_num">
                <span>已报{$yb}人</span>
                <span value="已满" class="count_none" style="font-size:12px;">
                </span>
				<div class="btn_null">报名</div>
			</dd>
            {else}
			<dd class="count_num">
                <span>结束</span>
                <span value="已满" class="count_none" style="font-size:12px;">
                </span>
				<div class="btn_null">报名</div>
			</dd>			
            {/if} 
		{/if} 	
        </dl>
        <dl class="count_tips">
            <dt>服务中心</dt>
			<dd class="count_add"><a href="#" id="map">{$school['address']}</a></dd>
			<dd class="count_phone"><a href="tel:{$school['tel']}" class="phone">{$school['tel']}</a></dd>
        </dl>
        <!--dl class="count_eval">
            <dt><a href="javascript:void(0)" id="allPinglun">老师评价<span>(0人评价)</span></a></dt>
        </dl-->
        <dl class="count_outline">
            <dt><a href="{php echo $this->createMobileUrl('kcdg', array('id' => $item['id'],'schoolid' => $schoolid), true)}" >课程大纲 <span class="outline_link" id="syllabus">查看详情</span></a></dt>
        </dl>
        <dl class="counts">
            <dt>课程表</dt>
            <div>
			{loop $list $item1}
                      <dd class="{if $item['date'] > TIMESTAMP}click{/if}">第<span>{$item1['nub']}</span>课<br/>{php echo date('m月d',$item1['date'])}</br>{if !empty($category[$item1['sd_id']])}{$category[$item1['sd_id']]['sname']}{/if}</dd>           
			{/loop}
                                <div style="clear:both"></div>
            </div>
        </dl>
    </div>
    <div class="user_info" id="user_info" style="display:none;">
	   <div style="border-radius: 5%;">
			<ul>
				<p>完善联系方式</p>
				<li class="user_name">
					<input type="text" placeholder="请输入您的姓名" name ="name" id="name" value="{if !empty($userinfo['name'])}{$userinfo['name']}{/if}">
					真实姓名
				</li>
				<li class="user_name">
					<input type="text" placeholder="请输入您的手机号" name ="mobile" id="mobile" value="{if !empty($userinfo['mobile'])}{$userinfo['mobile']}{/if}">
					手机号
				</li>
				<li class="user_name">是否接收其他学生或家长的信息
					<select id="is_allowmsg">
						<option value="2" {if $its['is_allowmsg'] ==2}selected="selected"{/if}>允许</option>
						<option value="1" {if $its['is_allowmsg'] ==1}selected="selected"{/if}>拒绝</option>
					</select>
				</li>				
				<div class="btn" onclick="Tijiao();">提交</div>
			</ul>
			<span id="close" onclick="Close();">×</span>
	   </div>
    </div>		
	<input id="userid" name="userid" type="hidden" value="{$its['id']}">
	<input id="umobile" name="umobile" type="hidden" value="{if !empty($userinfo)}{$userinfo['mobile']}{/if}">
	   {php include $this->template('footer');} 
<script>	
	var PB = new PromptBox();
	var userid =  $("#userid").val(); 
    function checkSigeup() {			
			PB.prompt("正在报名中请稍等！~","forever");
				var satr = "{$school['issale']}";				
				var url = "{php echo $this->createMobileUrl('order', array('schoolid' => $schoolid), true)}";			
			if (satr == 3 || satr == 4){			
				var url = "{php echo $this->createMobileUrl('myclass', array('schoolid' => $schoolid, 'bj_id' => $student['bj_id'], 'xq_id' => $student['xq_id']), true)}";			
			}
            if (userid == '') {
			    PB.prompt('请先绑定您的学生信息！','forever');
                window.location.href = "{php echo $this->createMobileUrl('bangding', array('schoolid' => $schoolid), true)}";
                return false;
            } else {
				var submitData = {
					schoolid : "{$schoolid}",
					weid     : "{$_W['uniacid']}",
					openid   : "{$openid}",
					uid      : "{$fan['uid']}",
					kcid     : "{$item['id']}",
					sid      : "{$student['id']}",
					user     : "{$its['id']}"
					};
				$.post("{php echo $this->createMobileUrl('payajax',array('op'=>'sigeup'))}",submitData,function(data){

					if(data.result){
						PB.prompt(data.msg);
						window.location.href = url;
					}else{
						PB.prompt(data.msg);
					}
				},'json');
            }
    }
    function Tijiao() {			
					
			var name = $("#name").val();
			var mobile = $("#mobile").val();
			var is_allowmsg = $("#is_allowmsg").val();
			reg=/^(0|86|17951)?(13[0-9]|15[012356789]|17[0-9]|18[0-9]|14[57])[0-9]{8}$/;
			if (name == "" || name == undefined || name == null) { 
			alert('请输入您的姓名！');
            return false;
			}	
			if (is_allowmsg == "" || is_allowmsg == undefined || is_allowmsg == null) { 
			alert('请选择是否接收其他家长私聊');
            return false;
			}			
			if (mobile == "" || mobile == undefined || mobile == null || !reg.test(mobile)) {
            alert('手机号有误或为空！');
            return false;
			} else {
				var	submitData = {
					schoolid:"{$schoolid}",
					userid:userid,
					name:name,
					is_allowmsg:is_allowmsg,
					mobile:mobile
					};
				$.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'useredit'))}",submitData,function(data){

					if(data.result){
						PB.prompt(data.msg);
						location.reload();
					}else{
						PB.prompt(data.msg);	
					}
				},'json');
            }
    }	
	function Sigeup() {
            if (userid == '') {
			    PB.prompt('请先绑定您的学生信息！','forever');
                window.location.href = "{php echo $this->createMobileUrl('bangding', array('schoolid' => $schoolid), true)}";
                return false;
            } else {	
				$('#user_info').show();
			}
	}
	function Close(){
	   $('#user_info').hide();
	}
	function gototinfo(){
	  window.location.href = "{php echo $this->createMobileUrl('tcinfo', array('schoolid' => $schoolid, 'tid' => $teacher['id']), true)}";
	}	
	
</script>	
</body>
</html>